The present invention relates to a bidirectional communication recognition device, a bidirectional communication recognition method and a storage medium for implementing a bidirectional communication recognition method in a communications system between a first device, such as a computer system, etc., and a second device, such as a printer, etc.
The IEEE (Institute of Electrical and Electronics Engineers) 1284 standard is known as a parallel interface standard for transmitting data and commands from a computer system, such as a personal computer, etc., to a printer.
This standard does not only apply to simply sending data and commands from a computer system, but providing functions for transmitting detailed status data about the state of the printer from the printer side to the computer side, it enables bidirectional communication between computer system and printer.
The byte mode and the nibble mode are two methods for implementing the function of transmitting printer status data to the computer system side.
The byte mode is a method for transmitting status data from the printer to the computer system making use of 8 parallel data lines which are normally used for transmitting data and commands from the computer system to the printer.
The nibble mode is a method for transmitting status data from the printer to the computer system which, instead of using the parallel data lines, uses 4 of the control lines (e.g. "BUSY", "ACK", "PE" and "SLCT") by sending 1 byte of data divided into 4 low-order bits and 4 high-order bits in two data transfer cycles.
With the nibble mode there is the disadvantage that, because 1 byte of data is divided in 2 data transfer cycles, the transfer speed is low Therefore, from the point of view of the processing speed and the operational efficiency of a computer system or a printer it is more advantageous to use the byte mode than the nibble mode for implementing the transmission of status data.
However, there are computer systems and printers which are not provided with the byte mode function. Consequently, for the sake of performing as efficient and fast a printing process as possible, the user, having verified the functions of the computer system and the printer, has to set the byte mode, before the printing process can take place, in the case that both the computer system and the printer support the byte mode, or has to set the nibble mode, for the printing process to take place, in the case where either the computer system or the printer, or both, do not support the byte mode.
Thus verifying the functions is troublesome and complicated for the user.
Therefore, a process, on the computer system side, for automatically recognizing the function of the computer system and of the printer and for setting the appropriate mode in accordance with the result of the process has been devised.
With this automatic recognition, the computer system and the printer are first set to the byte mode by a program run on the computer system, next the computer system requests the transfer of the ID and the status data from the printer over the parallel data lines.
If in response to this request, the correct data are transmitted from the printer to the computer system, it is recognized that the computer system and the printer can use the byte mode, after which bidirectional transmission in the byte mode can take place. On the other hand, if incorrect data are transmitted, because either the computer system or the printer or both do not have the byte mode function, or because of a functional problem with a switchbox or other device connected to the cable between the computer system and the printer, it can be determined that only unidirectional transmission from the computer system to the printer is possible; and since the byte mode is not possible, bidirectional transmission is thereafter implemented with the nibble mode being used for transmitting data from the printer.
However, if only the printer has the byte mode function and not the computer system, and the above-described automatic recognition takes place, there is the danger of the following problem occurring.
Namely, at the time of the automatic recognition mentioned before, first of all, a command requesting data transmission in byte mode is transmitted from the computer system over the parallel data line to the printer, by a program run on the computer system. This, being a normal transmission from the computer system to the printer, takes place without problem.
However, after that, because the ID and other data from the printer side are transmitted from the parallel data line to the computer system side, the program at the computer system side sets the computer system itself so as to receive data in the byte mode. However, since in reality the computer system does not have the byte mode function, it remains in the transmitting state.
In consequence, the computer system ends up receiving the transmitted output from the printer side while remaining in the transmitting state.
If such a transmission takes place, it has to be feared that, in the worst case, the interface of the computer system or of the printer will malfunction.